﻿/******************************************************************************************************************************
 * Class the is used to create "Recipe" type objects for use with the RecipeBox application
 * Author: Morgan Davis
 * Northwestern Michigan College (student assignment)
 * Created: 27 November 2013
 * ****************************************************************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RecipeBox
{
    public class Recipe
    {
        //The properties of the "Recipe" class
        #region Properties
        private string _name;

        public string name
        {
            get { return _name; }
            set
            { //make sure someone doesn't feed a blank field as a value
                if (value != "")
                    _name = value;
                else
                    throw new Exception();
            }
        }

        private string _creditedCook;

        public string creditedCook
        {
            get { return _creditedCook; }
            set
            { //make sure someone doesn't feed a blank field as a value
                if (value != "")
                    _creditedCook = value;
                else
                    throw new Exception();
                }
        }
        
        // a list that stores all of the seperate ingredients for the recipe
        private List<String> _ingredients;

        public List<String> ingredients
        {
            get { return _ingredients; }
            set { _ingredients = value; }
        }

        // a list the stores of the instructions associated with the recipe
        private List<String> _instructions;

        public List<String> instructions
        {
            get { return _instructions; }
            set { _instructions = value; }
        }
        #endregion 


        //override method of ToString used to format the string for display in a listbox
        public override string ToString()
        {
            return string.Format("{0}, Created By: {1}",
                this.name, this.creditedCook);
        }

    }
}
